package game.classes.particles.displays
{
	import engine.utils.GraphicUtils;
	
	import flash.display.Shape;

	public class StarOutline extends Shape
	{
		private var _color:uint;
		private var _outer:Number;
		private var _inner:Number;
		private var _numPoints:int;
		private var _thickness:Number;
		
		public function StarOutline(outer:Number, inner:Number, numPoints:int, thickness:Number, color:uint = 0xFFFFFF)
		{
			this._outer 	= outer;
			this._inner 	= inner;
			this._numPoints = numPoints;
			this._thickness = thickness;
			this._color 	= color;
			
			this.draw();
		}
		
		private function draw():void
		{
			this.graphics.clear();
			this.graphics.beginFill(this._color);
			GraphicUtils.drawStar(this.graphics, this._outer, this._inner, this._numPoints);
			GraphicUtils.drawStar(this.graphics, this._outer - this._thickness, this._inner - this._thickness, this._numPoints);
			this.graphics.endFill();
		}
		
		public function get color():uint { return this._color; }
		public function set color(color:uint):void
		{
			this._color = color;
			this.draw();
		}
		
		public function get outer():Number { return this._outer; }
		public function set outer(outer:Number):void
		{
			this._outer = outer;
			this.draw();
		}
		
		public function get inner():Number { return this._inner; }
		public function set inner(inner:Number):void
		{
			this._inner = inner;
			this.draw();
		}
		
		public function get numPoints():int { return this._numPoints; }
		public function set numPoints(numPoints:int):void
		{
			this._numPoints = numPoints;
			this.draw();
		}
		
		public function get thickness():Number { return this._thickness; }
		public function set thickness(thickness:Number):void
		{
			this._thickness = thickness;
			this.draw();
		}
	}
}